<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : ProductDetail.xsl
    Created on : May 26, 2013, 11:37 PM
    Author     : Kim
    Description:
        Purpose of transformation follows.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:param name="proID"/>
    <!-- TODO customize transformation rules 
         syntax recommendation http://www.w3.org/TR/xslt 
    -->
    <xsl:template match="products">
        
        
        <xsl:for-each select="product[proID=$proID]">
            <xsl:if test="(noSell='0')">
                <h1>
                    <xsl:value-of select="proName"/>
                </h1>
                <div class="content_half float_l">
                    <a>
                        <img style="width: 200px; height: 200px">
                            <xsl:attribute name="src">
                                <xsl:value-of select="Image"/>
                            </xsl:attribute>
                        </img>
                    </a>
                </div>
                <div class="content_half float_r">
                    <div>
                            <b>Price: </b>
                        <a style="color: red"><xsl:value-of select="format-number(Price, '###,###')"/> VND</a>
                    </div>
                    <div>
                            <b>Catalogue: </b>
                        <xsl:value-of select="catalogName"/>
                    </div>
                    <div>
                            <b>Brand: </b>
                        <xsl:value-of select="brandName"/>
                    </div>
                    <div>
                            <b>Made in </b>
                        <xsl:value-of select="proFrom"/>
                    </div>
                    <div>
                            <b>Description: </b>
                        <xsl:value-of select="Description"/>
                    </div>
                    <a style="float: left; display: block; width: 78px;
                        height: 28px; line-height: 28px; text-align: center;
                        color: #fff; background: darkturquoise;cursor: pointer;">
                            <xsl:attribute name="onclick" >addToCart(<xsl:value-of select="proID"/>,'<xsl:value-of select="proName"/>',<xsl:value-of select="Price"/>)</xsl:attribute> Add to Cart
                    </a>
                </div>
            </xsl:if>
        </xsl:for-each>
       
    </xsl:template>
</xsl:stylesheet>
